package run.siyuan.model;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import lombok.experimental.Accessors;

import java.math.BigDecimal;

/**
 * 佣金收益明细
 *
 * @author doz 2021-01-21
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@TableName("commission_record")
public class CommissionRecord extends SimpleEntity {

    // @ApiModelProperty("用户Id")
    private Long memberId;
    // @ApiModelProperty("下单用户Id")
    private Long fromMemberId;
    // @ApiModelProperty("订单类型: OrderTypeEnum枚举")
    private Integer orderType;
    // @ApiModelProperty("订单Id")
    private Long orderId;
    // @ApiModelProperty("子订单Id")
    private Long subOrderId;
    // @ApiModelProperty("商品Id")
    private Long itemId;
    // @ApiModelProperty("商品skuId")
    private Long skuId;
    // @ApiModelProperty("购买数量")
    private Integer quantity;
    // @ApiModelProperty("是否直接分佣 1-是 0-否")
    private Integer direct;
    // @ApiModelProperty("商品总价")
    private BigDecimal totalAmount;
    // @ApiModelProperty("销售金额")
    private BigDecimal saleAmount;
    // @ApiModelProperty("分佣比例")
    private BigDecimal proration;
    // @ApiModelProperty("佣金收益(未扣税)")
    private BigDecimal amount;
    // @ApiModelProperty("税率")
    private BigDecimal rate;
    // @ApiModelProperty("佣金收益(已扣税)")
    private BigDecimal actualAmount;
    // @ApiModelProperty("下单用户等级")
    private Integer fromMemberLevel;
    // @ApiModelProperty("分佣用户等级")
    private Integer memberLevel;
    // 和 commission_billing.source 保持一致
    // @ApiModelProperty("1.平台分佣;2.推广分佣;4.升级奖励 5.注册奖励 7.分享奖励")
    private Integer type;
    // @ApiModelProperty("-1-违规删除 0-正向佣金 1-逆向佣金")
    private Integer status;
    // @ApiModelProperty("结算状态 0-待结算;1-已结算")
    private Integer settleStatus;
    // @ApiModelProperty("佣金生成时间")
    private Long bizTime;
    // @ApiModelProperty("结算时间")
    private Long settleTime;
    // @ApiModelProperty("备注")
    private String remark;

    // @ApiModelProperty("入账状态（0未生成账单明细，1已入账，2未入账）")
    private Integer isCredit;
    // @ApiModelProperty("入账时间（毫秒）")
    private Long creditTime;
    // @ApiModelProperty("是否是分享订单（0否1是，指from_member_id是自己，但实际下单者为from_member_id用户分享的下级未登录用户订单")
    private Boolean isShare;
    // @ApiModelProperty("是否进入余额")
    private Boolean entryBalance;
    // @ApiModelProperty("进入余额时间")
    private Long entryBalanceTime;
}
